# -*- coding: utf-8 -*-
"""

"""

from locust import TaskSet, task, HttpUser, constant
import time
import os
from mimesis.schema import Schema
from mimesis import Person

schema = Schema(schema=lambda: {
    "name": "zhangsan",
    "password": "13578945621"
})

data = schema.create(3)
age = Person().age()
email = Person().email()
name= Person().name()
print(name)
print(email)
print(age)
print(data)

# class UserTask(TaskSet):
#     def __init__(self, parent):
#         super().__init__(parent)
#         self.index = 0
#
#     def on_start(self):
#         pass
#
#     @task
#     def test_visit(self):
#         print(f'share_data:{self.user.share_data}')
#         print(f"index:{self.index}")
#         url = self.user.share_data[self.index]
#         print(f'visit url: {url}')
#         self.client.get(url)
#         self.index = (self.index + 1) % len(self.user.share_data)
#         print(f"------------------------------------------------")
#
#
# class WebsiteUser(HttpUser):
#     host = 'http://www.baidu.com'
#     task_set = task(UserTask)
#     share_data = ['/s?wd=apple', '/s?wd=banana', '/s?wd=pear', '/s?wd=orange', '/s?wd=tea']
#     wait_time = constant(2)
#
#
# if __name__ == '__main__':
#     current_file_path = os.path.abspath(__file__)
#     os.system(f"locust -f {current_file_path}")
